package com.coderush.admin.sys.exception;

import com.coderush.admin.core.exception.BusinessException;

/**
 * PackageName com.coderush.admin.sys.exception
 *
 * @Author Eason
 * @Version v1.0
 * @ClassName RoleException
 * @Date 2025/8/29
 * @Description TODO
 */
public class RoleException extends BusinessException  {

    public RoleException(Integer code, String message) {
        super(code, message);
    }
    public RoleException(String message) {
        super(message);
    }

    public static RoleException roleNameExist() {
        return new RoleException(1031, "角色名称已存在");
    }
    public static RoleException roleCodeExist() {
        return new RoleException(1032, "角色编码已存在");
    }

    public static Exception roleNotExist() {
        return new RoleException(1033, "角色不存在");
    }

    public static Exception repeatRoleName() {
        return new RoleException(1034, "角色名称已存在");
    }

    public static Exception repeatRoleCode() {
        return new RoleException(1036, "角色编码已存在");
    }

    public static Exception systemRoleNotAllowedDelete() {
        return new RoleException(1037, "系统管理员不允许删除");
    }

    public static Exception roleStartedNotAllowedDelete() {
        return new RoleException(1038, "正在启动的角色不能被删除");
    }
}